﻿//谷歌服务
function GoogleMapService(layerInfo) {
    var GoogleMapService = new Object;
    GoogleMapService.id = layerInfo.hasOwnProperty("GUID") ? layerInfo.GUID : "";
    GoogleMapService.url = layerInfo.hasOwnProperty("URL") ? layerInfo.URL : "";
    GoogleMapService.name = layerInfo.hasOwnProperty("NAME") ? layerInfo.NAME : "";
    GoogleMapService.servertype = layerInfo.hasOwnProperty("SERVERTYPE") ? layerInfo.SERVERTYPE : "";
    GoogleMapService.CreateLayer = function () {
        var id = this.id;
        var url = this.url;
        var name = this.name;
        var servertype = this.servertype;
        var thisLayer = new ol.layer.Tile({
            source: new ol.source.XYZ({
                url: url,
                name: name,
                id:id,
                wrapX:false
            })
        });
        return thisLayer;
    }
    return GoogleMapService;
}